﻿#include "startgame.h"
#include "ui_startgame.h"
#include "gameover.h"
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    setWindowTitle("开始游戏");

    setWindowIcon(QIcon(":/RES/qqqqwwee.png"));
//    mplayer1->setMedia(QUrl("qrc:/1.mp3"));
//    mplayer1->setVolume(30);
//    mplayer1->play();
    ui->setupUi(this);
    choosemap *p=new choosemap;
    QObject::connect(this,SIGNAL(next()),p,SLOT(last()));//实现页面跳转

    this->setAutoFillBackground(true);
    // 创建调色板对象
    QPalette pi = this->palette();
    // 加载图片
    QPixmap pix(":/RES/download-file (4).jpg");
    pix=pix.scaled(1600,900);
    // 设置图片
    pi.setBrush(QPalette::Window, QBrush(pix));
    this->setPalette(pi);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::last()
{
    show();
}
void MainWindow::on_pushButton_clicked()
{
    this->hide();//该页面隐藏
    emit next();//激活信号
}
